//package com.hexiang.shardingsphere.sharding.algorithm;
//
//import com.ctrip.framework.apollo.Config;
//import com.ctrip.framework.apollo.ConfigService;
//import org.apache.shardingsphere.api.sharding.complex.ComplexKeysShardingAlgorithm;
//import org.apache.shardingsphere.api.sharding.complex.ComplexKeysShardingValue;
//
//import java.util.ArrayList;
//import java.util.Collection;
//
//public class OrderComplexKeysShardingAlgorithm implements ComplexKeysShardingAlgorithm<String> {
//
//    private static final String NO_SHARDING_TABLE_NAME = "t_order";
//
//    private static final String ORDER_SHARDING_SWITCH = "order.sharding.switch";
//
//    private static final String ORDER_SHARDING_SWITCH_OFF = "off";
//
//    private final Config config = ConfigService.getConfig("jdbc");
//
//    @Override
//    public Collection<String> doSharding(Collection<String> availableTargetNames, ComplexKeysShardingValue<String> complexKeysShardingValue) {
//        Collection<String> result = new ArrayList<>();
//        //不分片实现
//        if (ORDER_SHARDING_SWITCH_OFF.equals(config.getProperty(ORDER_SHARDING_SWITCH, ORDER_SHARDING_SWITCH_OFF))) {
//            result.add(NO_SHARDING_TABLE_NAME);
//            return result;
//        }
//        // 分片实现
//
//        return result;
//    }
//
//
//}
